plugins {
    id 'com.android.application'
    id 'org.jetbrains.kotlin.android'
}

android {

    signingConfigs {
        release {
            storeFile file("C://")
            storePassword ""
            keyAlias ""
            keyPassword ""
        }
    }

    namespace 'com.sakhalin.news'
    compileSdk 34

    defaultConfig {
        applicationId "com.sakhalin.news"
        minSdk 23
        versionCode 1
        versionName "1.0"

        vectorDrawables {
            useSupportLibrary true
        }
    }

    buildTypes {

        release {
            minifyEnabled true
            shrinkResources true
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
            signingConfig signingConfigs.release
        }

        debug{
            minifyEnabled true
            shrinkResources true
        }
    }


    //Сценарий именования apk файла при сборке
    applicationVariants.all { variant ->
        variant.outputs.each { output ->
            def versionName = variant.versionName
            def versionCode = variant.versionCode
            def variantName = variant.name // e. g. freeDebug
            def formattedDate = new Date().format('dd_MM_yy_HH_mm')

            def apkName = 'sakhalin_news_' + versionName + '_(build ' + versionCode + ')' + '_' + variantName + '_(' + formattedDate  +').apk'
            output.outputFileName = apkName
        }
    }

    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }

    kotlinOptions {
        jvmTarget = '1.8'
    }
    buildFeatures {
        compose true
    }
    composeOptions {
        kotlinCompilerExtensionVersion = "1.4.2"
    }
    packagingOptions {
        resources {
            excludes += '/META-INF/{AL2.0,LGPL2.1}'
        }
    }
}

dependencies {

    implementation 'androidx.core:core-ktx:1.10.1'
    implementation 'androidx.lifecycle:lifecycle-runtime-ktx:2.6.1'
    implementation 'androidx.activity:activity-compose:1.7.2'
    implementation "androidx.compose.ui:ui:$compose_ui_version"
    implementation "androidx.compose.ui:ui-tooling-preview:$compose_ui_version"
    implementation "androidx.compose.material:material:$compose_ui_version"
    implementation 'androidx.navigation:navigation-compose:2.6.0'
    implementation 'androidx.paging:paging-compose:3.2.0-rc01'

    implementation "com.google.accompanist:accompanist-pager:0.27.1"
    implementation "com.google.accompanist:accompanist-pager-indicators:0.27.1"
    implementation "com.google.accompanist:accompanist-systemuicontroller:0.27.1"

    implementation 'com.squareup.retrofit2:retrofit:2.9.0'
    implementation 'com.squareup.retrofit2:converter-gson:2.9.0'
    implementation 'com.squareup.okhttp3:okhttp:5.0.0-alpha.2'
    implementation 'com.squareup.okhttp3:logging-interceptor:5.0.0-alpha.11'

    implementation 'com.google.code.gson:gson:2.10.1'
    implementation 'io.coil-kt:coil-compose:2.4.0'
    implementation 'androidx.appcompat:appcompat:1.6.1'
    debugImplementation 'androidx.compose.ui:ui-tooling:1.6.0'
}